The Movie Toolbox provides a number of functions that allow your application to perform low-level editing operations on movies. These functions work with movie segments--pieces of a movie that are defined by a starting time and duration--and therefore give you a great deal of control over the editing process. These functions never copy the movie data; rather, they work with references to the movie's data. "Editing Movies," which begins on Editing Movies , discusses the Movie Toolbox functions that allow you to edit movies by working with the current selection.
You can use the CopyMovieSettings function to copy certain important settings from one movie to another.
You can use the InsertMovieSegment function to copy a segment from one movie to another. Use the InsertMovieEmptySegment function to insert an empty segment into a movie.
Your application can delete a segment from a movie by calling the DeleteMovieSegment function.
You can change a segment's duration by calling the ScaleMovieSegment function. This function stretches or shrinks the segment to accommodate a specified duration.
The InsertMovieSegment function copies part of one movie to another. You specify the starting time and duration of the source segment and the time in the destination movie at which to place the information.
pascal OSErr InsertMovieSegment (Movie srcMovie, Movie dstMovie,
TimeValue srcIn,
TimeValue srcDuration,
TimeValue dstIn);
The InsertMovieSegment function does not change the source movie. However, the duration of the destination movie is extended to accommodate the inserted segment. You can use this function to add a segment beyond the end of the destination movie--the Movie Toolbox inserts empty space as appropriate.
You can use the InsertMovieSegment function to copy data within a single movie. If you are not copying data from one location in a movie to a different point in the same movie, the function may create new tracks, as appropriate.
Whenever possible, the Movie Toolbox uses existing tracks to store the data to be inserted. Before adding a track to the destination movie, the toolbox looks in the destination movie for tracks that have the same characteristics as the tracks in the source movie. The toolbox considers the following characteristics when searching for an appropriate track:
If the Movie Toolbox cannot find an appropriate track in the destination movie, it creates a track with the proper characteristics.
If you have assigned a progress function to the destination movie, the Movie Toolbox calls that progress function during long copy operations. For details on application-defined progress functions, see "Progress Functions," .
The InsertEmptyMovieSegment function adds an empty segment to a movie. You specify the starting time and duration of the empty segment to be added. These times must be expressed in the movie's time scale.
pascal OSErr InsertEmptyMovieSegment (Movie dstMovie,
TimeValue dstIn,
TimeValue dstDuration);
The InsertEmptyMovieSegment function then inserts the appropriate amount of empty time into each of the movie's tracks. The exact meaning of the term empty time depends upon the type of track. For example, empty time in a sound track is silent.
You cannot add empty space to the end of a movie. If you want to insert a segment beyond the end of a movie, use the InsertMovieSegment function, which is described in the previous section.
The DeleteMovieSegment function removes a specified segment from a movie. You identify the segment to remove by specifying its starting time and duration.
pascal OSErr DeleteMovieSegment (Movie theMovie,
TimeValue startTime,
TimeValue duration);
The ScaleMovieSegment function changes the duration of a segment of a movie. The Movie Toolbox scales the segment to accommodate the new duration.
pascal OSErr ScaleMovieSegment (Movie theMovie,
TimeValue startTime,
TimeValue oldDuration,
TimeValue newDuration);
The CopyMovieSettings function copies many settings from one movie to another, overwriting the destination settings in the process.
pascal OSErr CopyMovieSettings (Movie srcMovie, Movie dstMovie);
The CopyMovieSettings function copies the
If you want to work with specific characteristics, you can use the Movie Toolbox functions that allow you to manipulate movie settings individually. These functions are described in "Functions That Modify Movie Properties," .
This function does not copy the movie's contents. To work with movie contents, you should use the segment editing functions described in "Low-Level Movie-Editing Functions," .